   /****************************************** 
  	 画图
   *******************************************/
   var bbtChart;
  
  function showBBTChart(){
  	initBBTChartData();  	
  	bbtChart.dispose();
  	drawBBTChart();
  }
  
  function setEChartConfig(){
      require.config({
					  paths: {
						echarts: './js'
					  }
				    });
    }
  
  function drawBBTChart(){
  	require(
	  [
		'echarts',
		'echarts/chart/line',
	  ],

	  function (ec) {
		bbtChart = ec.init(document.getElementById('bbtLineChart'));

		setBBTChartOption(bbtChart);
		
		
	  });
  }

  function setBBTChartOption(bbtChart){

  	bbtChart.setOption({
		
		  //设置坐标系占webview空间大小
		  grid: {
		  			x: gridX,
		  			y: gridY,
		  			x2: gridX2,
		  			y2: gridY2,
		  			borderWidth: 0.5
		  		},		  			
		  legend: {//图例
		  			show: false,
					data: [bgColor,bbtTitle]
		  		   },
		  tooltip : {//提示框，鼠标悬浮交互时的信息提示
		  				showContent: showTip,
						trigger: 'axis',//触发类型
						textStyle: {color: 'white'},
						//{a} 基础体温 {b} 日期  {c} 温度值
						//formatter: '日期: {b} <br/> 体温: {c} ºC<br/>'
						formatter: function(params){
									 //基础体温线数据
									 //var bbt_title = params[0][0];
									 var bbt_day = params[0][1];
									 //var bbt_temperature = params[1][2];

									 //判断所处周期:月经期，卵泡期，排卵期，黄体期
									 var tip = getFormatTip(bbt_day);

						             //动态显示detail
						             if(portraitOrLandscape == "portrait"){
										showBBTChartDetailForEach(bbt_day, customerDatePeriodMap.get(bbt_day));
									 }

						             document.getElementById('div_month').innerHTML = getBgMonthTip(bbt_day);

						             return tip;
						},
						axisPointer: {
							type: 'line',
							lineStyle: {
								color: 'rgba(244,146,51,1)',
								type: 'solid'
							}
						}
		  },
		  xAxis : [					
					{
					  type : 'category',
					  axisLine: {show: false},
					  axisTick: {show: false},					  
					  data: xAxisDateArray,
					  axisLabel: {
					  				formatter: function(value) {
													return getDayStr(value);														
												},
									textStyle: {fontSize : 10}
								  },
					  splitLine: {lineStyle: {width: 0.5}},
			  		  splitArea: { 
			  		  				show: true,
						   		    areaStyle: {
										    		color: bgColorDataArray
										    	} 
						      	  }
					}
		  	      ],
		  yAxis : [								      	
			      	{
					  show: true,
					  type : 'value',					  
					  min: yAxisMinTemperature,
					  max: yAxisMaxTemperature,
					  splitNumber: yAxisSplitNumber,					  
					  axisLine: {show: false},
					  splitLine: {lineStyle: {width: 0.5}},
					  axisLabel : { 
					  				show: false,
									formatter: function(value) {
																if(parseInt(value)==value)
																	return value + '.0'; 
																else
																	return '.' + (value*10)%10;																	
																}									   
					  			  }					  
			      	}
				  ],		  		  
		  series : [		  				
						{
						  name: bbtTitle,//图表名称
						  type:'line',//图表类型
						  data: polishedBBTDataArray,
						  clickable: false,
						  smooth: false,//平滑的曲线	
						  //symbol : 'circle',
		  				  //symbolSize: 4,
						  itemStyle: {normal: {color: '#4baedf',lineStyle: {} } }
						}						
		  			]
		}, true);
  }



    /****************************************** 
  	 设置提示内容
  	*******************************************/
   
    function getFormatTip(dateStr){
    	var periodDayNum = getDaysFromPreviousYjqStartDate(dateStr);
    	var period = getPeriodTitle(dateStr);
    	var temperature = customerDateTemperatureMap.get(dateStr);

    	var lang = localStorage.getItem("language");
    	if(lang == "chinese")
    		return '周期第' + periodDayNum + '天' + '<br/>日期: ' + dateStr + '<br/> 体温: ' + getDisplayTempValue(temperature) + getTempUnit() + '<br/>' + period;
    	else if(lang == "english")
    		return  'Day-' + periodDayNum + ' of Cycle' + '<br/>date: ' + dateStr + '<br/> BBT: ' + getDisplayTempValue(temperature) + getTempUnit() + '<br/>' + period;
    }
    
    
	function getPeriodTitle(xAxisDateStr){
    	var periodTitle;
    	
    	if(isYjq(xAxisDateStr))
    		periodTitle = yjqTitle;
    	else if(isLpq(xAxisDateStr))
    		periodTitle = lpqTitle;
    	else if(isPlq(xAxisDateStr))
    		periodTitle = plqTitle;
    	else if(isHtq(xAxisDateStr))
    		periodTitle = htqTitle;
    	else if(isAqq(xAxisDateStr))
    		periodTitle = aqqTitle;
    	else if(isWxq(xAxisDateStr))
    		periodTitle = wxqTitle;
    	else
    		periodTitle = unknownTitle;
    		
    	return periodTitle;
    }  
    
   function removeBBTChart(){
   		bbtChart.dispose();
   }